﻿using Quartz;
using Quartz.Impl;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication2.pushApi
{
    public class JobFactory
    {
        IScheduler scheduler;
        public JobFactory()
        {
            //从工厂中获取一个调度器实例化
            scheduler = StdSchedulerFactory.GetDefaultScheduler();
            scheduler.Start();       //开启调度器


            
        }

        public void ScheduleJob(IJobDetail job, ITrigger itr)
        {
            scheduler.ScheduleJob(job, itr);      //把作业，触发器加入调度器。
        }
    }
}
